@model PagedList<member_entity>
@{
    ViewData["Title"] = "会员管理";
}
@section Scripts{
<script>
    $(function(){
        $(".review").on("click",function(){
            var id = $(this).data("id");
            $.ajax({
                url: "/v6admin/api/member_api/review",
                data: {
                    "member_id": id
                },
                success: function(res){
                    layer.msg(res.msg);
                    setTimeout("location.reload()", 3000);
                }
            });
        });
    });
</script>
}
<div class="layui-card">
    <div class="layui-card-header">
        @ViewData["Title"]
    </div>
    <div class="layui-card-body">
        <table class="layui-table">
            <thead>
                <tr>
                    <th>
                        @Html.DisplayNameFor(model => model.id)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.username)
                    </th>
                    @*<th>
                        @Html.DisplayNameFor(model => model.nick_name)
                    </th>*@
                    <th>
                        @Html.DisplayNameFor(model => model.real_name)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.company)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.mobile)
                    </th>
                    @*<th>
                        @Html.DisplayNameFor(model => model.card_id)
                    </th>*@
                    <th>
                        @Html.DisplayNameFor(model => model.is_lock)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.reg_time)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.reg_ip)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.member_level)
                    </th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                @if (Model.Count() == 0)
                {
                    <tr>
                        <td colspan="10" style="text-align: center;">
                            <div class="layui-inline">--没有记录--</div>
                        </td>
                    </tr>
                }
                @foreach (var item in Model)
                {
                    <tr>
                        <td>
                            @Html.DisplayFor(modelItem => item.id)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.username)
                        </td>
                        @*<td>
                            @Html.DisplayFor(modelItem => item.nick_name)
                        </td>*@
                        <td>
                            @Html.DisplayFor(modelItem => item.real_name)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.company)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.mobile)
                        </td>
                        @*<td>
                            @Html.DisplayFor(modelItem => item.card_id)
                        </td>*@
                        <td>
                            @Html.DisplayFor(modelItem => item.is_lock)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.reg_time)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.reg_ip)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.member_level)
                        </td>
                        <td style="text-align: right;">
                            <a asp-action="edit" asp-route-id="@item.id">修改</a> |
                            @if (item.member_level == member_level_enum.注册会员)
                            {
                                <a href="###" class="review" data-id="@item.id">审核</a>
                                <span>|</span>
                            }
                            <a asp-action="delete" asp-route-id="@item.id" onclick="return confirm('确认删除吗？');">删除</a>
                        </td>
                    </tr>
                }
            </tbody>
        </table>
        <div style="text-align: center;padding: 16px 0 12px 0;">
            <div class="layui-inline">
                @Html.Pager(Model, new PagerOptions
                {
                PageIndexParameterName = "page",
                TagName = "ul",
                CssClass = "pagination",
                CurrentPagerItemTemplate = "<li class=\"page-item active\"><a  class=\"page-link\" href=\"javascript:void(0);\">{0}</a></li>",
                DisabledPagerItemTemplate = "<li class=\"page-item disabled\"><a class=\"page-link\">{0}</a></li>",
                PagerItemTemplate = "<li class=\"page-item\">{0}</li>",
                PagerItemCssClass = "page-link",
                Id = "bootstrappager"
                })
            </div>
        </div>
    </div>
</div>
